.class public Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaActionHandler;
.super Landroid/app/Activity;
.source "OrmmaActionHandler.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaActionHandler$2;
    }
.end annotation


# instance fields
.field private mActionData:Ljava/util/HashMap;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/HashMap",
            "<",
            "Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaView$ACTION;",
            "Ljava/lang/Object;",
            ">;"
        }
    .end annotation
.end field

.field private mLayout:Landroid/widget/RelativeLayout;


# direct methods
.method public constructor <init>()V
    .locals 1

    .prologue
    .line 32
    invoke-direct {p0}, Landroid/app/Activity;-><init>()V

    .line 37
    new-instance v0, Ljava/util/HashMap;

    invoke-direct {v0}, Ljava/util/HashMap;-><init>()V

    iput-object v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaActionHandler;->mActionData:Ljava/util/HashMap;

    return-void
.end method

.method private doAction(Landroid/os/Bundle;)V
    .locals 5
    .parameter "data"

    .prologue
    .line 61
    const-string v3, "action"

    invoke-virtual {p1, v3}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    .line 62
    .local v0, actionData:Ljava/lang/String;
    if-nez v0, :cond_0

    .line 78
    :goto_0
    return-void

    .line 65
    :cond_0
    invoke-static {v0}, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaView$ACTION;->valueOf(Ljava/lang/String;)Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaView$ACTION;

    move-result-object v1

    .line 67
    .local v1, actionType:Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaView$ACTION;
    sget-object v3, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaActionHandler$2;->$SwitchMap$com$burstly$lib$component$networkcomponent$burstly$html$ormma$OrmmaView$ACTION:[I

    invoke-virtual {v1}, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaView$ACTION;->ordinal()I

    move-result v4

    aget v3, v3, v4

    packed-switch v3, :pswitch_data_0

    goto :goto_0

    .line 69
    :pswitch_0
    invoke-virtual {p0, p1, v1}, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaActionHandler;->initPlayer(Landroid/os/Bundle;Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaView$ACTION;)Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/util/OrmmaPlayer;

    move-result-object v2

    .line 70
    .local v2, player:Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/util/OrmmaPlayer;
    invoke-virtual {v2}, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/util/OrmmaPlayer;->playAudio()V

    goto :goto_0

    .line 73
    .end local v2           #player:Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/util/OrmmaPlayer;
    :pswitch_1
    invoke-virtual {p0, p1, v1}, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaActionHandler;->initPlayer(Landroid/os/Bundle;Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaView$ACTION;)Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/util/OrmmaPlayer;

    move-result-object v2

    .line 74
    .restart local v2       #player:Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/util/OrmmaPlayer;
    invoke-virtual {v2}, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/util/OrmmaPlayer;->playVideo()V

    goto :goto_0

    .line 67
    nop

    :pswitch_data_0
    .packed-switch 0x1
        :pswitch_0
        :pswitch_1
    .end packed-switch
.end method

.method private setPlayerListener(Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/util/OrmmaPlayer;)V
    .locals 1
    .parameter "player"

    .prologue
    .line 119
    new-instance v0, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaActionHandler$1;

    invoke-direct {v0, p0}, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaActionHandler$1;-><init>(Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaActionHandler;)V

    invoke-virtual {p1, v0}, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/util/OrmmaPlayer;->setListener(Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/util/OrmmaPlayerListener;)V

    .line 135
    return-void
.end method


# virtual methods
.method initPlayer(Landroid/os/Bundle;Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaView$ACTION;)Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/util/OrmmaPlayer;
    .locals 7
    .parameter "playData"
    .parameter "actionType"

    .prologue
    .line 88
    const-string v5, "player_properties"

    invoke-virtual {p1, v5}, Landroid/os/Bundle;->getParcelable(Ljava/lang/String;)Landroid/os/Parcelable;

    move-result-object v4

    check-cast v4, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaController$PlayerProperties;

    .line 89
    .local v4, properties:Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaController$PlayerProperties;
    const-string v5, "expand_dimensions"

    invoke-virtual {p1, v5}, Landroid/os/Bundle;->getParcelable(Ljava/lang/String;)Landroid/os/Parcelable;

    move-result-object v2

    check-cast v2, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaController$Dimensions;

    .line 90
    .local v2, playDimensions:Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaController$Dimensions;
    new-instance v3, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/util/OrmmaPlayer;

    invoke-direct {v3, p0}, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/util/OrmmaPlayer;-><init>(Landroid/content/Context;)V

    .line 91
    .local v3, player:Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/util/OrmmaPlayer;
    const-string v5, "expand_url"

    invoke-static {v5, p1}, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/util/OrmmaUtils;->getData(Ljava/lang/String;Landroid/os/Bundle;)Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v3, v4, v5}, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/util/OrmmaPlayer;->setPlayData(Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaController$PlayerProperties;Ljava/lang/String;)V

    .line 93
    invoke-static {}, Lcom/burstly/lib/util/Utils;->getFillparentValue()I

    move-result v0

    .line 94
    .local v0, fillparentVal:I
    if-nez v2, :cond_0

    .line 95
    new-instance v1, Landroid/widget/RelativeLayout$LayoutParams;

    invoke-direct {v1, v0, v0}, Landroid/widget/RelativeLayout$LayoutParams;-><init>(II)V

    .line 96
    .local v1, lp:Landroid/widget/RelativeLayout$LayoutParams;
    const/16 v5, 0xd

    invoke-virtual {v1, v5}, Landroid/widget/RelativeLayout$LayoutParams;->addRule(I)V

    .line 104
    :goto_0
    invoke-virtual {v3, v1}, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/util/OrmmaPlayer;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V

    .line 105
    iget-object v5, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaActionHandler;->mLayout:Landroid/widget/RelativeLayout;

    invoke-virtual {v5, v3}, Landroid/widget/RelativeLayout;->addView(Landroid/view/View;)V

    .line 107
    iget-object v5, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaActionHandler;->mActionData:Ljava/util/HashMap;

    invoke-virtual {v5, p2, v3}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 108
    invoke-direct {p0, v3}, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaActionHandler;->setPlayerListener(Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/util/OrmmaPlayer;)V

    .line 110
    return-object v3

    .line 99
    .end local v1           #lp:Landroid/widget/RelativeLayout$LayoutParams;
    :cond_0
    new-instance v1, Landroid/widget/RelativeLayout$LayoutParams;

    iget v5, v2, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaController$Dimensions;->width:I

    iget v6, v2, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaController$Dimensions;->height:I

    invoke-direct {v1, v5, v6}, Landroid/widget/RelativeLayout$LayoutParams;-><init>(II)V

    .line 100
    .restart local v1       #lp:Landroid/widget/RelativeLayout$LayoutParams;
    iget v5, v2, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaController$Dimensions;->y:I

    iput v5, v1, Landroid/widget/RelativeLayout$LayoutParams;->topMargin:I

    .line 101
    iget v5, v2, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaController$Dimensions;->x:I

    iput v5, v1, Landroid/widget/RelativeLayout$LayoutParams;->leftMargin:I

    goto :goto_0
.end method

.method public onCreate(Landroid/os/Bundle;)V
    .locals 4
    .parameter "savedInstanceState"

    .prologue
    .line 46
    invoke-super {p0, p1}, Landroid/app/Activity;->onCreate(Landroid/os/Bundle;)V

    .line 47
    invoke-virtual {p0}, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaActionHandler;->getIntent()Landroid/content/Intent;

    move-result-object v2

    invoke-virtual {v2}, Landroid/content/Intent;->getExtras()Landroid/os/Bundle;

    move-result-object v0

    .line 48
    .local v0, data:Landroid/os/Bundle;
    new-instance v2, Landroid/widget/RelativeLayout;

    invoke-direct {v2, p0}, Landroid/widget/RelativeLayout;-><init>(Landroid/content/Context;)V

    iput-object v2, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaActionHandler;->mLayout:Landroid/widget/RelativeLayout;

    .line 49
    invoke-static {}, Lcom/burstly/lib/util/Utils;->getFillparentValue()I

    move-result v1

    .line 50
    .local v1, fillparentVal:I
    iget-object v2, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaActionHandler;->mLayout:Landroid/widget/RelativeLayout;

    new-instance v3, Landroid/view/ViewGroup$LayoutParams;

    invoke-direct {v3, v1, v1}, Landroid/view/ViewGroup$LayoutParams;-><init>(II)V

    invoke-virtual {v2, v3}, Landroid/widget/RelativeLayout;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V

    .line 51
    iget-object v2, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaActionHandler;->mLayout:Landroid/widget/RelativeLayout;

    invoke-virtual {p0, v2}, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaActionHandler;->setContentView(Landroid/view/View;)V

    .line 52
    invoke-direct {p0, v0}, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaActionHandler;->doAction(Landroid/os/Bundle;)V

    .line 53
    return-void
.end method

.method protected onStop()V
    .locals 5

    .prologue
    .line 139
    iget-object v3, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaActionHandler;->mActionData:Ljava/util/HashMap;

    invoke-virtual {v3}, Ljava/util/HashMap;->entrySet()Ljava/util/Set;

    move-result-object v3

    invoke-interface {v3}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v1

    .local v1, i$:Ljava/util/Iterator;
    :goto_0
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v3

    if-eqz v3, :cond_0

    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/util/Map$Entry;

    .line 140
    .local v0, entry:Ljava/util/Map$Entry;,"Ljava/util/Map$Entry<Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaView$ACTION;Ljava/lang/Object;>;"
    sget-object v4, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaActionHandler$2;->$SwitchMap$com$burstly$lib$component$networkcomponent$burstly$html$ormma$OrmmaView$ACTION:[I

    invoke-interface {v0}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaView$ACTION;

    invoke-virtual {v3}, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaView$ACTION;->ordinal()I

    move-result v3

    aget v3, v4, v3

    packed-switch v3, :pswitch_data_0

    goto :goto_0

    .line 143
    :pswitch_0
    invoke-interface {v0}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/util/OrmmaPlayer;

    .line 144
    .local v2, player:Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/util/OrmmaPlayer;
    invoke-virtual {v2}, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/util/OrmmaPlayer;->releasePlayer()V

    goto :goto_0

    .line 150
    .end local v0           #entry:Ljava/util/Map$Entry;,"Ljava/util/Map$Entry<Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaView$ACTION;Ljava/lang/Object;>;"
    .end local v2           #player:Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/util/OrmmaPlayer;
    :cond_0
    invoke-super {p0}, Landroid/app/Activity;->onStop()V

    .line 151
    return-void

    .line 140
    :pswitch_data_0
    .packed-switch 0x1
        :pswitch_0
        :pswitch_0
    .end packed-switch
.end method
